package com.example.shop.fgo.utils;

import com.example.shop.fgo.task.download.model.DownloadFileRootPath;
import com.example.shop.fgo.entity.FileListEntity;

import java.io.File;
import java.util.List;

/**
 * Created by Administrator on 2017/2/21.
 */

public class SavePathUtil {
    public static String getDirPath(List<FileListEntity.PathEntity> pathEntities){
        StringBuilder stringBuilder = new StringBuilder(DownloadFileRootPath.getRootPath());
        for (FileListEntity.PathEntity pathEntity : pathEntities) {
            stringBuilder.append(pathEntity.getName());
            stringBuilder.append("/");
        }
        String dirPath=stringBuilder.toString();
        File file=new File(dirPath);
        //帮助创建父目录的各级文件夹
        file.mkdirs();
        return dirPath;
    }
}
